std::time

From Cppreference

< cpp | chrono | c
Jump to: navigation, search
Defined in header <ctime>

time_t time( time_t *time );

Gets the time since epoch as a time_t object.

Contents

[edit] Parameters

time - pointer to a time_t object to store the time in. If NULL is passed instead, internal static object is used

[edit] Return value

time since epoch as a time_t object on success, -1 on error.

[edit] Example

[edit] See also

localtime
converts time since epoch to calendar time expressed as local time
(function)
gmtime
converts time since epoch to calendar time expressed as Universal Coordinated Time
(function)